
import mongoose from 'mongoose'
const RequestFromIP = mongoose.model('RequestFromIP')
mongoose.set('useFindAndModify', false)

export const CountRequestIP = async (ctx) => {
    // 计算单个API的IP访问次数
  const requestInfo = {
    api: ctx.path,
    ip: ctx.ip,
    appid: ctx.query.appid
  }
  await RequestFromIP.create(requestInfo)
}
